package com.example.haxballandroid;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;

public class MenuActivity extends Activity {

	public final static String MESSAGE_TAG = "com.example.haxballandroid.MESSAGE";
	private Intent intentAct, intentServ;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_menu);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_menu, menu);
		return true;
	}

	/** Called when the user clicks the Join button */
	public void viewServerList(View view){
		intentServ = new Intent(this, ActionUpdate.class);
		intentServ.putExtra(MESSAGE_TAG, "refresh");
		startService(intentServ);
		intentAct = new Intent(this, JoinActivity.class);
		startActivity(intentAct);
	}

	/** Called when the user clicks the Create button */
	public void createServer(View view){
		intentAct = new Intent(this, CreateActivity.class);
		startActivity(intentAct);
	}
	
	/** Called when the user clicks the Settings button */
	public void settings(View view){
		intentAct = new Intent(this, SettingsActivity.class);
		startActivity(intentAct);
	}	
	
	

}
